<!DOCTYPE html>
<html>
    <head>
		<meta name="renderer" content="webkit">
		<meta http-equiv="Cache-Control" content="no-siteapp" />
		<meta http-equiv="X-UA-Compatible" content="IE=edge">
		<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
    	<title>登陆</title>
    	<meta name="keywords" content="后台管理 登陆" />
    	<meta name="description" content="登陆页面" />
    	<meta charset="utf-8"/>
		<meta name = "format-detection" content = "telephone=no">
    	<link rel="stylesheet" href="css/main.css" type="text/css" />
		<link rel="shortcut icon" href="../favicon.ico" /> 
		<?php
			session_start();
		    error_reporting(0);
		    require('../inc/func.php');
			require('../inc/mysql.php');
			
			if($_GET['action']=='save'){
				$username=$_POST['username'];
				$password=$_POST['pwd'];
				$password=md5($password);
				
				$db->query('select * from adminUser where username=\''.$username.'\' and password=\''.$password.'\' limit 1');
			
				if($db->num_rows()>0){
					$_SESSION['loginUserName']=$username;
					$_SESSION['loginPassword']=$password;
					echo "<script>window.location.href='../store.php'</script>";exit();
				}else{redirect('请认真检查账号和密码','redirect','index.php');exit();}
			}
		?>
    </head>
	<body>
		<div class="login">
			<form action="?action=save" method="post">
				<div class="box png">
					<div class="logo png"></div>
					<div class="input">
						<div class="log">
							<div class="name">
								<label>用户名</label><input type="text" class="text" id="value_1" placeholder="用户名" name="username" tabindex="1">
							</div>
							<div class="pwd">
								<label>密　码</label><input type="password" class="text" id="value_2" placeholder="密码" name="pwd" tabindex="2">
								<input type="submit" class="submit" tabindex="3" value="登录">
								<div class="check"></div>
							</div>
							<div class="tip"></div>
						</div>
					</div>
				</div>
			</form>
			<div class="air-balloon ab-1 png"></div>
			<div class="air-balloon ab-2 png"></div>
			<div class="footer"></div>
		</div>
		<script type="text/javascript" src="js/jQuery.js"></script>
		<script type="text/javascript" src="js/fun.base.js"></script>
		<script type="text/javascript" src="js/script.js"></script>
		</div>
	</body>
</html>